--平台历史增幅
alter table jms_tmp.tmp_platform_forecast_increase_rt_dt set tblproperties ('external.table.purge'='true');
drop table jms_tmp.tmp_platform_forecast_increase_rt_dt
create external table jms_tmp.tmp_platform_forecast_increase_rt_dt (
   date_time string comment '日期',
   weekday_eg string comment '周几',
   source_code string comment'平台：tb淘宝，pdd拼多多',
   source_value_a int comment '单量',
   bill_date_b date comment'对比日期',
   source_value_b int comment '对比单量',
   rt decimal(16,4) comment'增幅'  
) COMMENT '各平台增幅'
PARTITIONED BY (dt STRING COMMENT '日期')
STORED AS PARQUET
LOCATION '/dw/hive/jms_tmp.db/external/tmp_platform_forecast_increase_rt_dt'
TBLPROPERTIES (
'discover.partitions'='false',
'parquet.column.index.access'='true'
);
   
--平台单量预测
alter table jms_dm.dm_platform_forecast_waybill_cnt_dt set tblproperties ('external.table.purge'='true');
drop table jms_dm.dm_platform_forecast_waybill_cnt_dt
create external table jms_dm.dm_platform_forecast_waybill_cnt_dt (
   date_time string comment '预测日期',
   weekday_eg string comment '对应星期',
   source_code string comment '平台tb淘宝，pdd拼多多',
   rt decimal(16,4) comment'增幅（各公司相加）', 
   waybill_cnt int comment '单量',
   forecast_waybill_cnt int comment '预测单量',
   version_flag string  comment'增幅版本，2021,2022'
) COMMENT '平台单量预测'
PARTITIONED BY (dt STRING COMMENT '日期')
STORED AS PARQUET
LOCATION '/dw/hive/jms_dm.db/external/dm_platform_forecast_waybill_cnt_dt'
TBLPROPERTIES (
'discover.partitions'='false',
'parquet.column.index.access'='true'
);

--网点单量预测
alter table jms_dm.dm_network_forecast_waybill_cnt_dt set tblproperties ('external.table.purge'='true');
drop table  jms_dm.dm_network_forecast_waybill_cnt_dt
create external table jms_dm.dm_network_forecast_waybill_cnt_dt (
   date_time date comment '预测日期',
   network_code string comment '网点编码',
   network_name string comment'网点名称',
   taking_cnt decimal(16,4) comment'预测揽件量',
   deliver_cnt decimal(16,4) comment '预测派件量',
   version_flag string comment '版本 2021,2022'
) COMMENT '网点单量预测'
PARTITIONED BY (dt STRING COMMENT '日期')
STORED AS PARQUET
LOCATION '/dw/hive/jms_dm.db/external/dm_network_forecast_waybill_cnt_dt'
TBLPROPERTIES (
'discover.partitions'='false',
'parquet.column.index.access'='true'
);
     